// 用户管理页面相关api
import request from '@/utils/request'

// 获取管理用户分页列表
// /admin/acl/user/{page}/{limit}  get
export const reqGetUserList = (page, limit, searchObj) => request({ url: `/admin/acl/user/${page}/${limit}`, method: 'get', params: searchObj })

// 新增管理用户
// /admin/acl/user/save post
export const reqAddUser = (user) => request({ url: `/admin/acl/user/save`, method: 'post', data: user })

// 获取管理用户
// /admin/acl/user/get/{id} get
export const reqGetuser = (id) => request({ url: `/admin/acl/user/get/${id}`, method: 'get' })

// 修改管理用户
// /admin/acl/user/update put
export const reqUpdataUser = (user) => request({ url: `/admin/acl/user/update`, method: 'put', data: user })

// 根据用户获取角色数据
// /admin/acl/user/toAssign/{userId} get
export const reqGetRole = (userId) => request({ url: `/admin/acl/user/toAssign/${userId}`, method: 'get' })

// 根据用户分配角色
// /admin/acl/user/doAssign post
export const reqDoAssign = (data) => request({ url: `/admin/acl/user/doAssign`, method: 'post', params: data })


// 删除用户
// /admin/acl/user/remove/{id} delete
export const reqDeleteUser = (id) => request({ url: `/admin/acl/user/remove/${id}`, method: 'delete' })

// 根据id列表删除管理用户
// /admin/acl/user/batchRemove delete
export const reqDeleteUserList = (idList) => request({ url: `/admin/acl/user/batchRemove`, method: 'delete', data: idList })